/*
 *    This program is free software; you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation; either version 2 of the License, or
 *    (at your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 *    2010 year
 *    Author: Michael Khromov aka MikeDM (Mike D'Morto)
 *    E-Mail: mikedm@list.ru
 */


#ifndef MCORE_H
#define MCORE_H

#include <QObject>
//#include <QHttp>
#include <QTimer>
#include <QBuffer>
#include <QProcess>
#include "mconfig.h"
#include "mlog.h"

class mcore : public QObject
{
Q_OBJECT
public:
    explicit mcore(QString apppath,QObject *parent = 0);
    void start(); // start core (main thread for work)
private:
    QString apath; // applocation path
    QString crt;
    mconfig cfg;    // config
    mlog applog;    // applocation log
    QTimer timertik; // timer for tik tak =)
    bool lock; // blocking of time interval (TIK)
    int stage; // stages of work
    QProcess pro;
//    QBuffer buff;
//    QTimer timer;
//    QFile fname;




//    mlog applog;

    QString id_task;
    QString sname;
    QString spath;
    QString serverhash;
    void execscript(const QString & script);
signals:

public slots:
private slots:
    void slot_tik(); // timer interval handler
    void slot_pfin(int); // process finished handler


};

#endif // MCORE_H
